import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    meta:{
      bj:false,
    }
  },
  {
    path: '/A',
    name: 'List',
    component: () => import('../views/List.vue'),
    meta:{
      bj:true
    }
  },
  {
    path: '/lx',
    name: 'ListX',
    component: () => import('../views/ListX.vue'),
    meta:{
      bj:true
    }
  },
  {
    path: '/fuwu',
    name: 'fuwu',
    component: () => import('../views/fuwu.vue'),
    meta:{
      bj:false
    }
  },
  {
    path: '/yz',
    name: 'yz',
    component: () => import('../views/yz.vue'),
    meta:{
      bj:false
    }
  },
  {
    path: '/suixiny',
    name: 'suixiny',
    component: () => import('../views/suixiny.vue'),
    meta:{
      bj:true
    }
  },
  {
    path: '/file',
    name: 'file',
    component: () => import('../views/file.vue'),
    meta:{
      bj:false
    }
  },
  {
    path: '/me',
    name: 'me',
    component: () => import('../views/me.vue'),
    meta:{
      bj:false
    }
  },
  {
    path: '/MapContainer',
    name: 'MapContainer',
    component: () => import('../views/MapContainer.vue'),
    meta:{
      bj:true
    }
  }
]
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
